Deprecate and ignore the timeout-initial and timeout-repeat settings
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Tue, 9 Jul 2013 20:44:04 +0000 (16:44 -0400)
committerWilliam Jon McCann <william.jon.mccann@gmail.com>
Thu, 11 Jul 2013 21:08:15 +0000 (17:08 -0400)
gdk/win32/gdkproperty-win32.c
gdk/x11/gdksettings.c
gtk/gtkcalendar.c
gtk/gtknotebook.c
gtk/gtkpathbar.c
gtk/gtkrange.c
gtk/gtksettings.c
gtk/gtkspinbutton.c

index 975ff33adc0713f4c7c424a23ea2a17e16f403e1..59ab2c8b0cd21631840178873b4317bd2e2c78ae 100644 (file)
@@ -311,8 +311,6 @@ _gdk_win32_window_delete_property (GdkWindow *window,
   "Gtk/Modules\0"             "gtk-modules\0"
   "Gtk/CursorThemeName\0"     "gtk-cursor-theme-name\0"
   "Gtk/CursorThemeSize\0"     "gtk-cursor-theme-size\0"
-  "Gtk/TimeoutInitial\0"      "gtk-timeout-initial\0"
-  "Gtk/TimeoutRepeat\0"       "gtk-timeout-repeat\0"
   "Gtk/ColorScheme\0"         "gtk-color-scheme\0"
   "Gtk/EnableAnimations\0"    "gtk-enable-animations\0"
   "Xft/Antialias\0"           "gtk-xft-antialias\0"
index 07f6aa0422a7a0eec07ffe2a3ecbbecaac489e0c..b9e653228c6e92da0e5778880611f9a8c4ffd7f2 100644 (file)
@@ -36,8 +36,6 @@ static const struct {
   {"Gtk/Modules",             "gtk-modules"},
   {"Gtk/CursorThemeName",     "gtk-cursor-theme-name"},
   {"Gtk/CursorThemeSize",     "gtk-cursor-theme-size"},
-  {"Gtk/TimeoutInitial",      "gtk-timeout-initial"},
-  {"Gtk/TimeoutRepeat",       "gtk-timeout-repeat"},
   {"Gtk/ColorScheme",         "gtk-color-scheme"},
   {"Gtk/EnableAnimations",    "gtk-enable-animations"},
   {"Xft/Antialias",           "gtk-xft-antialias"},
index 588a905dc239aee820c3bf829afc02227bd209a9..2f0646e015d75fe37eba1ceaefb0f4355a73e2d0 100644 (file)
@@ -81,6 +81,9 @@
 #include "gtktooltip.h"
 #include "gtkprivate.h"
 
+#define TIMEOUT_INITIAL  500
+#define TIMEOUT_REPEAT    50
+
 /***************************************************************************/
 /* The following date routines are taken from the lib_date package.
  * They have been minimally edited to avoid conflict with types defined
@@ -2884,15 +2887,9 @@ calendar_timer (gpointer data)
 
       if (priv->need_timer)
         {
-          GtkSettings *settings;
-          guint        timeout;
-
-          settings = gtk_widget_get_settings (GTK_WIDGET (calendar));
-          g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
           priv->need_timer = FALSE;
           priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
-                                            timeout * SCROLL_DELAY_FACTOR,
+                                            TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
                                             (GSourceFunc) calendar_timer,
                                             (gpointer) calendar, NULL);
         }
@@ -2913,15 +2910,9 @@ calendar_start_spinning (GtkCalendar *calendar,
 
   if (!priv->timer)
     {
-      GtkSettings *settings;
-      guint        timeout;
-
-      settings = gtk_widget_get_settings (GTK_WIDGET (calendar));
-      g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
-
       priv->need_timer = TRUE;
       priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
-                                        timeout,
+                                        TIMEOUT_INITIAL,
                                         (GSourceFunc) calendar_timer,
                                         (gpointer) calendar, NULL);
     }
index 2b4d832e677af0345e87d6298f721781cf9a695d..b44c84aac6eb02f7ad4ea1d01237558a3675a9fa 100644 (file)
 #define FRAMES_PER_SECOND     45
 #define MSECS_BETWEEN_UPDATES (1000 / FRAMES_PER_SECOND)
 
+#define TIMEOUT_INITIAL  500
+#define TIMEOUT_REPEAT    50
+#define TIMEOUT_EXPAND   500
+
 typedef struct _GtkNotebookPage GtkNotebookPage;
 
 typedef enum
@@ -3368,8 +3372,6 @@ gtk_notebook_motion_notify (GtkWidget      *widget,
   GtkNotebookPage *page;
   GtkNotebookArrow arrow;
   GtkNotebookPointerPosition pointer_position;
-  GtkSettings *settings;
-  guint timeout;
   gint x_win, y_win;
 
   page = priv->cur_page;
@@ -3433,10 +3435,7 @@ gtk_notebook_motion_notify (GtkWidget      *widget,
           if (!priv->dnd_timer)
             {
               priv->has_scrolled = TRUE;
-              settings = gtk_widget_get_settings (GTK_WIDGET (notebook));
-              g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
-              priv->dnd_timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+              priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
                                                scroll_notebook_timer,
                                                (gpointer) notebook);
             }
@@ -3700,9 +3699,7 @@ gtk_notebook_drag_motion (GtkWidget      *widget,
   GtkNotebookPrivate *priv = notebook->priv;
   GtkAllocation allocation;
   GdkRectangle position;
-  GtkSettings *settings;
   GtkNotebookArrow arrow;
-  guint timeout;
   GdkAtom target, tab_target;
   GList *tab;
   gboolean retval = FALSE;
@@ -3775,10 +3772,7 @@ gtk_notebook_drag_motion (GtkWidget      *widget,
 
       if (!priv->switch_tab_timer)
         {
-          settings = gtk_widget_get_settings (widget);
-
-          g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
-          priv->switch_tab_timer = gdk_threads_add_timeout (timeout,
+          priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
                                                   gtk_notebook_switch_tab_timeout,
                                                   widget);
         }
@@ -4834,14 +4828,8 @@ gtk_notebook_timer (GtkNotebook *notebook)
 
       if (priv->need_timer)
         {
-          GtkSettings *settings;
-          guint        timeout;
-
-          settings = gtk_widget_get_settings (GTK_WIDGET (notebook));
-          g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
           priv->need_timer = FALSE;
-          priv->timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+          priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
                                            (GSourceFunc) gtk_notebook_timer,
                                            (gpointer) notebook);
         }
@@ -4856,16 +4844,10 @@ static void
 gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
 {
   GtkNotebookPrivate *priv = notebook->priv;
-  GtkWidget *widget = GTK_WIDGET (notebook);
 
   if (!priv->timer)
     {
-      GtkSettings *settings = gtk_widget_get_settings (widget);
-      guint timeout;
-
-      g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
-
-      priv->timer = gdk_threads_add_timeout (timeout,
+      priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
                                        (GSourceFunc) gtk_notebook_timer,
                                        (gpointer) notebook);
       priv->need_timer = TRUE;
index 10767b90984c1d68143565c096dc344baec89a26..e8d15b821d2ba9ff6d08b93ec2d7c6b0a6b3c2d2 100644 (file)
@@ -85,6 +85,8 @@ typedef enum {
 #define BUTTON_DATA(x) ((ButtonData *)(x))
 
 #define SCROLL_DELAY_FACTOR 5
+#define TIMEOUT_INITIAL     500
+#define TIMEOUT_REPEAT      50
 
 static guint path_bar_signals [LAST_SIGNAL] = { 0 };
 
@@ -1071,14 +1073,9 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
 
       if (path_bar->priv->need_timer) 
        {
-          GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (path_bar));
-          guint        timeout;
-
-          g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
          path_bar->priv->need_timer = FALSE;
 
-         path_bar->priv->timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+         path_bar->priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
                                           (GSourceFunc)gtk_path_bar_scroll_timeout,
                                           path_bar);
        }
@@ -1181,13 +1178,8 @@ gtk_path_bar_slider_button_press (GtkWidget      *widget,
 
   if (!path_bar->priv->timer)
     {
-      GtkSettings *settings = gtk_widget_get_settings (widget);
-      guint        timeout;
-
-      g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
-
       path_bar->priv->need_timer = TRUE;
-      path_bar->priv->timer = gdk_threads_add_timeout (timeout,
+      path_bar->priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
                                       (GSourceFunc)gtk_path_bar_scroll_timeout,
                                       path_bar);
     }
index 9ef4ff362b2216bd27892122705b54be479af584..7bc95caa34f0468abc1302f991b7da0526f78554 100644 (file)
@@ -60,6 +60,8 @@
 
 #define SCROLL_DELAY_FACTOR 5    /* Scroll repeat multiplier */
 #define UPDATE_DELAY        300  /* Delay for queued update */
+#define TIMEOUT_INITIAL     500
+#define TIMEOUT_REPEAT      50
 
 typedef struct _GtkRangeStepTimer GtkRangeStepTimer;
 
@@ -4068,13 +4070,8 @@ initial_timeout (gpointer data)
 {
   GtkRange *range = GTK_RANGE (data);
   GtkRangePrivate *priv = range->priv;
-  GtkSettings *settings;
-  guint        timeout;
 
-  settings = gtk_widget_get_settings (GTK_WIDGET (data));
-  g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
-  priv->timer->timeout_id = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+  priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
                                                      second_timeout,
                                                      range);
   /* remove self */
@@ -4086,18 +4083,13 @@ gtk_range_add_step_timer (GtkRange      *range,
                           GtkScrollType  step)
 {
   GtkRangePrivate *priv = range->priv;
-  GtkSettings *settings;
-  guint        timeout;
 
   g_return_if_fail (priv->timer == NULL);
   g_return_if_fail (step != GTK_SCROLL_NONE);
 
-  settings = gtk_widget_get_settings (GTK_WIDGET (range));
-  g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
-
   priv->timer = g_new (GtkRangeStepTimer, 1);
 
-  priv->timer->timeout_id = gdk_threads_add_timeout (timeout,
+  priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
                                                      initial_timeout,
                                                      range);
   priv->timer->step = step;
index 2c84ba3d952c57ff5f80e7422330f56d7f6894b9..e5d31c4a087c8ff7a6ee53d975b46889d3d375b2 100644 (file)
@@ -98,8 +98,8 @@
  */
 
 
-#define DEFAULT_TIMEOUT_INITIAL 200
-#define DEFAULT_TIMEOUT_REPEAT   20
+#define DEFAULT_TIMEOUT_INITIAL 500
+#define DEFAULT_TIMEOUT_REPEAT   50
 #define DEFAULT_TIMEOUT_EXPAND  500
 
 typedef struct _GtkSettingsPropertyValue GtkSettingsPropertyValue;
@@ -664,22 +664,32 @@ gtk_settings_class_init (GtkSettingsClass *class)
                                              NULL);
   g_assert (result == PROP_SHOW_UNICODE_MENU);
 
+  /**
+   * GtkSettings:gtk-timeout-initial:
+   *
+   * Deprecated: 3.10: This setting is ignored.
+   */
   result = settings_install_property_parser (class,
                                              g_param_spec_int ("gtk-timeout-initial",
                                                                P_("Start timeout"),
                                                                P_("Starting value for timeouts, when button is pressed"),
                                                                0, G_MAXINT, DEFAULT_TIMEOUT_INITIAL,
-                                                               GTK_PARAM_READWRITE),
+                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
                                              NULL);
 
   g_assert (result == PROP_TIMEOUT_INITIAL);
 
+  /**
+   * GtkSettings:gtk-timeout-repeat:
+   *
+   * Deprecated: 3.10: This setting is ignored.
+   */
   result = settings_install_property_parser (class,
                                              g_param_spec_int ("gtk-timeout-repeat",
                                                                P_("Repeat timeout"),
                                                                P_("Repeat value for timeouts, when button is pressed"),
                                                                0, G_MAXINT, DEFAULT_TIMEOUT_REPEAT,
-                                                               GTK_PARAM_READWRITE),
+                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
                                              NULL);
 
   g_assert (result == PROP_TIMEOUT_REPEAT);
index 7af3c48367dd39bff6df1b57b5e933bcb1b864a6..13d29d4cd67f5f383c92f1e064c95e2b3ea80482 100644 (file)
@@ -58,7 +58,8 @@
 #define EPSILON               1e-10
 #define MAX_DIGITS            20
 #define MIN_ARROW_WIDTH       6
-
+#define TIMEOUT_INITIAL       500
+#define TIMEOUT_REPEAT        50
 
 /**
  * SECTION:gtkspinbutton
@@ -1459,14 +1460,9 @@ start_spinning (GtkSpinButton *spin,
 
   if (!priv->timer)
     {
-      GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (spin));
-      guint        timeout;
-
-      g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
-
       priv->timer_step = step;
       priv->need_timer = TRUE;
-      priv->timer = gdk_threads_add_timeout (timeout,
+      priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
                                    (GSourceFunc) gtk_spin_button_timer,
                                    (gpointer) spin);
     }
@@ -1590,13 +1586,8 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
 
       if (priv->need_timer)
         {
-          GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (spin_button));
-          guint        timeout;
-
-          g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
           priv->need_timer = FALSE;
-          priv->timer = gdk_threads_add_timeout (timeout,
+          priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT,
                                               (GSourceFunc) gtk_spin_button_timer,
                                               (gpointer) spin_button);
         }